package com.gimi.cloud.bbp.client.controller.alipay;

import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSON;
import com.gimi.cloud.bbp.client.service.alipay.AlipayNotifyService;
import com.gimi.cloud.bbp.common.utils.reqhead.Util;

/**
 * 支付宝异步通知
 * @author 李林峰
 * @version 1.0
 * @Description
 * @create 2018年2月6日
 */
@Controller
@RequestMapping("/alipay")
public class AlipayNotifyController {
	@Autowired AlipayNotifyService alipayNotifyService;
	
	@RequestMapping("/notify")
	public void alipayNotify(@RequestBody Map<String, String[]> params, HttpServletResponse response) {
		Util.sendResponse(JSON.toJSONString(alipayNotifyService.alipayNotify(params)),response);
	}
}